<?php
/*
 * File: UserMemberController.php
 * Project: NewDemo
 * Created Time: 2024-07-02 09:17:20 am
 * Author: WangYuQiang && WangpeiGang (719404171@qq.com)
 * -----
 * Last Modified: 2024-07-24 4:16:19 pm
 * Modified By: WangYuQiang (719404171@qq.com>)
 * -----
 * Copyright (c) 2023 - 2024 成都睿創科技有限公司
 */


namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\UserMember;
use Illuminate\Http\Request;

class UserMemberController
 extends Controller
{
    protected $UserMember;

    public function __construct()
    {
        $this->UserMember = new UserMember();
    }

    /**
     * 獲取會員等級列表
     * @return array
     */
    public function getMemberListWeb(){
        $data = UserMember::get()->toArray();
        if(empty($data)){
            $data = [];
        }
        return $this->success(__('web.success'),$data);
    }

    /**
     * 修改會員等級
     * @param Request $request
     * @return array
     */
    public function editMemberListWeb(Request $request){
        $data = $request->post();
        $state = $this->UserMember->editMemberListWeb($data);
        return $state;
    }

}
